package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SnmpSensorinfoMapper;
import com.ruoyi.system.domain.SnmpSensorinfo;
import com.ruoyi.system.service.ISnmpSensorinfoService;

/**
 * 传感器Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-25
 */
@Service
public class SnmpSensorinfoServiceImpl implements ISnmpSensorinfoService 
{
    @Autowired
    private SnmpSensorinfoMapper snmpSensorinfoMapper;

    /**
     * 查询传感器
     * 
     * @param sensorId 传感器主键
     * @return 传感器
     */
    @Override
    public SnmpSensorinfo selectSnmpSensorinfoBySensorId(String sensorId)
    {
        return snmpSensorinfoMapper.selectSnmpSensorinfoBySensorId(sensorId);
    }

    /**
     * 查询传感器列表
     * 
     * @param snmpSensorinfo 传感器
     * @return 传感器
     */
    @Override
    public List<SnmpSensorinfo> selectSnmpSensorinfoList(SnmpSensorinfo snmpSensorinfo)
    {
        return snmpSensorinfoMapper.selectSnmpSensorinfoList(snmpSensorinfo);
    }

    /**
     * 新增传感器
     * 
     * @param snmpSensorinfo 传感器
     * @return 结果
     */
    @Override
    public int insertSnmpSensorinfo(SnmpSensorinfo snmpSensorinfo)
    {
        snmpSensorinfo.setCreateTime(DateUtils.getNowDate());
        return snmpSensorinfoMapper.insertSnmpSensorinfo(snmpSensorinfo);
    }

    /**
     * 修改传感器
     * 
     * @param snmpSensorinfo 传感器
     * @return 结果
     */
    @Override
    public int updateSnmpSensorinfo(SnmpSensorinfo snmpSensorinfo)
    {
        snmpSensorinfo.setUpdateTime(DateUtils.getNowDate());
        return snmpSensorinfoMapper.updateSnmpSensorinfo(snmpSensorinfo);
    }

    /**
     * 批量删除传感器
     * 
     * @param sensorIds 需要删除的传感器主键
     * @return 结果
     */
    @Override
    public int deleteSnmpSensorinfoBySensorIds(String[] sensorIds)
    {
        return snmpSensorinfoMapper.deleteSnmpSensorinfoBySensorIds(sensorIds);
    }

    /**
     * 删除传感器信息
     * 
     * @param sensorId 传感器主键
     * @return 结果
     */
    @Override
    public int deleteSnmpSensorinfoBySensorId(String sensorId)
    {
        return snmpSensorinfoMapper.deleteSnmpSensorinfoBySensorId(sensorId);
    }
}
